package xyz.awesomeman.service;

import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import xyz.awesomeman.dao.test1.UserMapper1;
import xyz.awesomeman.dao.test2.UserMapper2;
@Service
public class UserServiceImpl implements UserService {
	@Autowired
	UserMapper1 userMapper1;
	@Autowired
	UserMapper2 userMapper2;
	
	//
	@Transactional
	public void addUser1(String username, String password) {
		// TODO Auto-generated method stub
		userMapper1.addUser(username, password);
		
	}
	@Transactional
	public void addUser2(String username, String password) {
		// TODO Auto-generated method stub
		userMapper2.addUser(username, password);
	}

	@Override
	@Transactional
	public void addUser3(String username, String password) {
		// TODO Auto-generated method stub
		userMapper1.addUser(username, password);
		//int i = 1/0;
		userMapper2.addUser(username, password);
	}

}
